package name.fowler.refactoring.simplestore;

import java.util.ArrayList;
import java.util.List;

public class Customer {
	private String m_Name;
	private List<Rental> m_Rentals = new ArrayList<Rental>();

	public Customer(String name) {
		m_Name = name;
	}

	public String getName() {
		return m_Name;
	}

	public void addRental(Rental arg){
		m_Rentals.add(arg);
	}

	public List<Rental> getRentals() {
		return m_Rentals;
	}
	
	public double bill() {
		double totalAmount = 0;
		for (Rental each: getRentals()) {
			totalAmount += each.bill();
		}
		return totalAmount;
	}
}
